/*
 * @Description: 接口请求
 * @Author: bxsdhx
 * @Date: 2023-09-09 22:46:29
 * @LastEditTime: 2024-12-21 21:39:23
 * Copyright (C) 2023 bxsdhx. All rights reserved.
 */
import xhr from "@/ajax/xhr";
export default {
  /**
   * xhr原始请求
   */
  xhr,
  /**
   * @description: 登录
   * @param {string} param.account 账号
   * @param {string} param.password 密码
   * @return {*}
   */
  login(param: { account: string; password: string }): ReturnType<typeof xhr> {
    return xhr("/api/user/login", "get", param);
  },
  /**
   * @description: 上传文件
   * @param {File} file 文件
   * @param {any} onprogress 上传进度
   * @return {*}
   */
  upload(file: File, onprogress?: any): ReturnType<typeof xhr> {
    const form = new FormData();
    form.set("file", file);
    return xhr("/api/manage/common/common/upload", "post", form, onprogress);
  },
};
